<?php echo $this->fetch('header.html'); ?>
<script type="text/javascript">
$(function(){
  $('#yuyueTime').datepicker({dateFormat: 'yy-mm-dd',minDate: +0, maxDate: "+30D"});
});
</script>
<style>
.kdorder_add {background:#e9e9e9;}
.kdorder_add td{padding:5px; background:#FFF; line-height:22px}
.kdorder_add th {font-size:13px; color:#333; background:#f0f7ff; width:150px; font-weight:normal;text-align:right; padding-right:5px;}
.kdorder_add th em {font-style:normal; color:#F00; margin-right:8px}
.kdorder_add .select_class {border: 1px #fff solid;height: 30px;border-radius:2px;width:50%}
.inputBorder{border: 1px #fff solid;height: 20px;line-height: 20px;padding:4px 0; width:50%}
.botton_submit {border:0;background:#ed5736;height:31px;width:100px;text-align:center;line-height:31px;font-family:"Microsoft YaHei";font-size:14px;color:#fff;cursor:pointer;border-radius:4px; margin-right:10px}
</style>
<div id="rightTop">
  <ul class="subnav">
    <li><a class="btn1" href="index.php?app=kd_qujian">预约记录</a></li>
    <li><a class="btn0" href="index.php?app=kd_qujian&act=add">添加预约</a></li>
  </ul>
</div>
<form action="" method="post" id="form_box">
<table width="100%" cellspacing="1" class="kdorder_add">
  <tr><td colspan="2" style="padding:12px 8px;background:#ffffe5">重要提示：后台添加取件记录一般是帮客户下预约的，例如接到客户的电话预约，即可添加取件记录。</td></tr>
  <tr>
    <th><em>*</em>转运类别：</th>
    <td>
    <select name="cangku" id="cangku" class="select_class">
    <option value="0">=请选择=</option>
    <?php $_from = $this->_var['category']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'list');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['list']):
?>
    <option value="<?php echo $this->_var['list']['cate_name']; ?>" <?php if ($this->_var['info']['cangku'] == $this->_var['list']['cate_name']): ?>selected="selected"<?php endif; ?>><?php echo $this->_var['list']['cate_name']; ?></option>
    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </select>        
    </td>
  </tr>
  <tr>
    <th><em>*</em>预约时间：</th>
    <td><input type="input" class="inputBorder" name="yuyueTime" id="yuyueTime" placeholder="请选择预约取件的时间" value="<?php if ($this->_var['info']['yuyueTime']): ?><?php echo local_date("Y-m-d",$this->_var['info']['yuyueTime']); ?><?php endif; ?>"/></td>
  </tr>    
  <tr>
    <th><em>*</em>取货件数：</th>
    <td>
    <select name="qujianNumber" id="qujianNumber" class="select_class">
    <option selected="selected" value="0">=请选择=</option>
    <option value="1" <?php if ($this->_var['info']['qujianNumber'] == '1'): ?>selected="selected"<?php endif; ?>>1</option>
    <option value="2" <?php if ($this->_var['info']['qujianNumber'] == '2'): ?>selected="selected"<?php endif; ?>>2</option>
    <option value="3" <?php if ($this->_var['info']['qujianNumber'] == '3'): ?>selected="selected"<?php endif; ?>>3</option>
    <option value="4" <?php if ($this->_var['info']['qujianNumber'] == '4'): ?>selected="selected"<?php endif; ?>>4</option>
    <option value="5" <?php if ($this->_var['info']['qujianNumber'] == '5'): ?>selected="selected"<?php endif; ?>>5</option>
    <option value="6" <?php if ($this->_var['info']['qujianNumber'] == '6'): ?>selected="selected"<?php endif; ?>>6</option>
    <option value="7" <?php if ($this->_var['info']['qujianNumber'] == '7'): ?>selected="selected"<?php endif; ?>>7</option>
    <option value="8" <?php if ($this->_var['info']['qujianNumber'] == '8'): ?>selected="selected"<?php endif; ?>>8</option>
    <option value="9" <?php if ($this->_var['info']['qujianNumber'] == '9'): ?>selected="selected"<?php endif; ?>>9</option>
    <option value="10" <?php if ($this->_var['info']['qujianNumber'] == '10'): ?>selected="selected"<?php endif; ?>>10</option>
    <option value="更多" <?php if ($this->_var['info']['qujianNumber'] == '更多'): ?>selected="selected"<?php endif; ?>>更多</option>
    </select>
    </td>
  </tr>
  <tr>
    <th><em>*</em>联系人：</th>
    <td><input type="input" class="inputBorder" name="lianxiren" id="lianxiren" value="<?php echo $this->_var['info']['lianxiren']; ?>" placeholder="请输入联系人"/></td>
  </tr>
  <tr>
    <th><em>*</em>联系人电话：</th>
    <td><input type="input" class="inputBorder" name="mobilphone" id="mobilphone" value="<?php echo $this->_var['info']['mobilphone']; ?>" placeholder="请输入联系人电话"/></td>
  </tr>
  <tr>
    <th><em>*</em>联系人邮箱：</th>
    <td><input type="input" class="inputBorder" name="Email" id="Email"  value="<?php echo $this->_var['info']['Email']; ?>" placeholder="请输入联系人邮箱"/></td>
  </tr>   
  <tr>
    <th><em>*</em>国家/地区：</th>
    <td style="font-size:13px;"><input name="txt_country" type="text" id="txt_country" class="inputBorder" style="width:90px;" value="<?php echo $this->_var['info']['txt_country']; ?>" placeholder="国家/地区"/>&nbsp;
          省/州：<input name="txt_province" type="text" id="txt_province" class="inputBorder" style="width:90px;" value="<?php echo $this->_var['info']['txt_province']; ?>" placeholder="省/州"/>&nbsp;
          城市：<input name="txt_city" type="text" id="txt_city" class="inputBorder" style="width:90px;" value="<?php echo $this->_var['info']['txt_city']; ?>" placeholder="城市"/>&nbsp;
    </td>
  </tr>
  <tr>
    <th><em>*</em>详细地址：</th>
    <td><input name="address" type="text" id="address" class="inputBorder"  value="<?php echo $this->_var['info']['address']; ?>" placeholder="请输入详细地址"/></td>
  </tr>      
  <tr>
    <th>邮编：</th>
    <td><input name="postoffice" type="text" id="postoffice" class="inputBorder"  value="<?php echo $this->_var['info']['postoffice']; ?>" placeholder="请输入邮编"/>
    </td>
  </tr>         
  <tr>
    <th valign="top" style="padding-top:8px">客户备注：</th>
    <td><?php if ($this->_var['info']['notes']): ?><?php echo $this->_var['info']['notes']; ?><?php else: ?><textarea name="notes" id="notes" class="inputBorder" style="height:50px;" placeholder="请输入预约取件的备注说明"></textarea><?php endif; ?></td>
  </tr>
  <tr>
    <th>状态：</th>
    <td>
    <select name="status" id="status" class="select_class" style="border-color:#CCC">
    <option value="0" <?php if ($this->_var['info']['status'] == '0'): ?>selected="selected"<?php endif; ?>>未处理</option>
    <option value="1" <?php if ($this->_var['info']['status'] == '1'): ?>selected="selected"<?php endif; ?>>已完成</option>
    <option value="2" <?php if ($this->_var['info']['status'] == '2'): ?>selected="selected"<?php endif; ?>>已取消</option>
    </select>    
    </td>
  </tr>   
  <tr>
    <th valign="top" style="padding-top:8px">管理员备注：</th>
    <td><?php if ($this->_var['info']['admin_genzong']): ?><p><?php echo(@ereg_replace("\r\n","<br />",$this->_var['info']['admin_genzong'])); ?></p><?php endif; ?>
      <input name="admin_genzong" type="text" class="inputBorder" id="admin_genzong" style="border-color:#CCC" value="" placeholder="请输入管理员备注" /></td>
  </tr>     
  <tr>
    <th>&nbsp;</th>
    <td>
    <input type="button" name="imgButton" class="botton_submit" value="确认提交" onclick="return Check_form();" />
    <input type="reset" class="botton_submit" value="返回上一页" style="background:#999" onclick="javascript:history.back();"/>
    <input type="hidden" name="http_referer" value="<?php echo($_SERVER['HTTP_REFERER']); ?>"/>
    <?php if ($this->_var['info']['qujian_id']): ?>
    <input type="hidden" name="yubao_id"  value="<?php echo $this->_var['order_info']['yubao_id']; ?>"/><input type="hidden" name="act"  value="edit"/>
    <?php else: ?>
    <input type="hidden" name="act"  value="add"/>
    <?php endif; ?>
 </td>
  </tr>
</table>
</form>
<script type="text/javascript">
//sumbit form
function Check_form() {
  if ($("#cangku").val() == "0") {alert("请选择转运类别");$("#cangku").focus(); return false;}
  if ($("#yuyueTime").val() == "") {alert("请选择预约时间");$("#yuyueTime").focus(); return false;}
  if ($("#qujianNumber").val() == "0") {alert("请选择取货件数");$("#qujianNumber").focus(); return false;}
  if ($("#lianxiren").val() == "") {alert("请输入联系人");$("#lianxiren").focus(); return false;}
  if ($("#mobilphone").val() == "") {alert("请输入联系人电话");$("#mobilphone").focus(); return false;}
  if ($("#Email").val() == "") {alert("请输入联系人邮箱");$("#Email").focus(); return false;}
  if ($("#txt_country").val() == "") {alert("请输入所在国家/地区");$("#txt_country").focus(); return false;}
  if ($("#txt_province").val() == "") {alert("请输入所在省/州");$("#txt_province").focus(); return false;}
  if ($("#txt_city").val() == "") {alert("请输入所在城市");$("#txt_city").focus(); return false;}
  if ($("#address").val() == "") {alert("请输入详细地址");$("#address").focus(); return false;}
  
  $("#form_box").submit();
}
</script>
<?php echo $this->fetch('footer.html'); ?>